<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT">










<meta name="description" content="&amp;#x524D;&amp;#x63D0;&amp;#xFF1A; &amp;#x6700;&amp;#x8FD1;&amp;#x603B;&amp;#x662F;&amp;#x770B;&amp;#x5230;&amp;#x6709;&amp;#x4EBA;&amp;#x5728;&amp;#x95EE;&amp;#x53D1;&amp;#x5E03;&amp;#x5E94;&amp;#x7528;&amp;#x5230;Google Play&amp;#x4E4B;&amp;#x540E;&amp;#xFF0C;&amp;#x7B7E;&amp;#x540D;&amp;#x6">
<meta property="og:type" content="article">
<meta property="og:title" content="Android 关于加入Google签名计划（分配的签名文件）Google和Facebook登录不成功的问题">
<meta property="og:url" content="http://yoursite.com/2020/01/20/Android 关于加入Google签名计划（分配的签名文件）Google和Facebook登录不成功的问题/index.html">
<meta property="og:site_name" content="Silence潇湘夜雨">
<meta property="og:description" content="&amp;#x524D;&amp;#x63D0;&amp;#xFF1A; &amp;#x6700;&amp;#x8FD1;&amp;#x603B;&amp;#x662F;&amp;#x770B;&amp;#x5230;&amp;#x6709;&amp;#x4EBA;&amp;#x5728;&amp;#x95EE;&amp;#x53D1;&amp;#x5E03;&amp;#x5E94;&amp;#x7528;&amp;#x5230;Google Play&amp;#x4E4B;&amp;#x540E;&amp;#xFF0C;&amp;#x7B7E;&amp;#x540D;&amp;#x6">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2020-01-20T10:39:19.683Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Android 关于加入Google签名计划（分配的签名文件）Google和Facebook登录不成功的问题">
<meta name="twitter:description" content="&amp;#x524D;&amp;#x63D0;&amp;#xFF1A; &amp;#x6700;&amp;#x8FD1;&amp;#x603B;&amp;#x662F;&amp;#x770B;&amp;#x5230;&amp;#x6709;&amp;#x4EBA;&amp;#x5728;&amp;#x95EE;&amp;#x53D1;&amp;#x5E03;&amp;#x5E94;&amp;#x7528;&amp;#x5230;Google Play&amp;#x4E4B;&amp;#x540E;&amp;#xFF0C;&amp;#x7B7E;&amp;#x540D;&amp;#x6">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":true,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2020/01/20/Android 关于加入Google签名计划（分配的签名文件）Google和Facebook登录不成功的问题/">





  <title>Android 关于加入Google签名计划（分配的签名文件）Google和Facebook登录不成功的问题 | Silence潇湘夜雨</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Silence潇湘夜雨</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">Android开发一枚</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home //首页"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user //关于"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags  //标签"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th //分类"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive //归档"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-schedule">
          <a href="/schedule/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-calendar //日程表"></i> <br>
            
            日程表
          </a>
        </li>
      
        
        <li class="menu-item menu-item-sitemap">
          <a href="/sitemap.xml" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-sitemap //站点地图"></i> <br>
            
            站点地图
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/01/20/Android 关于加入Google签名计划（分配的签名文件）Google和Facebook登录不成功的问题/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Silence潇湘夜雨">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Silence潇湘夜雨">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Android 关于加入Google签名计划（分配的签名文件）Google和Facebook登录不成功的问题</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2020-01-20T18:29:23+08:00">
                2020-01-20
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/登录/" itemprop="url" rel="index">
                    <span itemprop="name">登录</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  1.9k
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  11
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="&#x524D;&#x63D0;&#xFF1A;"><a href="#&#x524D;&#x63D0;&#xFF1A;" class="headerlink" title="&#x524D;&#x63D0;&#xFF1A;"></a>&#x524D;&#x63D0;&#xFF1A;</h3><blockquote>
<p>&#x6700;&#x8FD1;&#x603B;&#x662F;&#x770B;&#x5230;&#x6709;&#x4EBA;&#x5728;&#x95EE;&#x53D1;&#x5E03;&#x5E94;&#x7528;&#x5230;Google Play&#x4E4B;&#x540E;&#xFF0C;&#x7B7E;&#x540D;&#x6539;&#x53D8;&#x4E86;&#xFF0C;&#x7136;&#x540E;&#x5BFC;&#x81F4;<strong>&#x767B;&#x5F55;&#x4E0D;&#x6210;&#x529F;</strong>&#x7684;&#x95EE;&#x9898;&#x3002;&#x4E4B;&#x524D;&#x6CA1;&#x600E;&#x4E48;&#x5728;&#x610F;&#xFF0C;&#x4F46;&#x662F;&#xFF0C;&#x95EE;&#x7684;&#x4EBA;&#x591A;&#x4E86;&#x4E4B;&#x540E;&#x5C31;&#x60F3;&#x7740;&#xFF0C;&#x65E2;&#x7136;&#x95EE;&#x7684;&#x4EBA;&#x8FD9;&#x4E48;&#x591A;&#xFF0C;&#x90A3;&#x4E48;&#x76F4;&#x63A5;&#x5199;&#x4E00;&#x7BC7;&#x6587;&#x7AE0;&#x6765;&#x7EDF;&#x4E00;&#x8BF4;&#x660E;&#x4E00;&#x4E0B;&#x89E3;&#x51B3;&#x65B9;&#x5F0F;&#x3002;</p>
</blockquote>
<h4 id="&#x9996;&#x5148;"><a href="#&#x9996;&#x5148;" class="headerlink" title="&#x9996;&#x5148;"></a>&#x9996;&#x5148;</h4><p>   &#x4E4B;&#x524D;&#x52A0;&#x5165;&#x5230;Google&#x7B7E;&#x540D;&#x8BA1;&#x5212;&#x662F;&#x4E00;&#x4E2A;&#x53EF;&#x9009;&#x9879;&#xFF0C;&#x4F46;&#x662F;&#xFF0C;&#x6700;&#x8FD1;&#x53D1;&#x5E03;&#x7684;&#x5E94;&#x7528;&#x597D;&#x50CF;&#x9ED8;&#x8BA4;&#x5C31;&#x4F1A;&#x5206;&#x914D;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x7B7E;&#x540D;&#x3002;&#x8FD9;&#x5C31;&#x7ED9;&#x6211;&#x4EEC;&#x6D4B;&#x8BD5;&#x589E;&#x52A0;&#x4E86;&#x96BE;&#x5EA6;&#xFF0C;&#x9700;&#x8981;&#x4F7F;&#x7528;Google&#x65B0;&#x5206;&#x914D;&#x7684;&#x7B7E;&#x540D;&#x6587;&#x4EF6;&#x7684;<code>SHA1</code>&#x6765;&#x91CD;&#x65B0;&#x914D;&#x7F6E;&#x767B;&#x5F55;&#x9700;&#x8981;&#x7684;&#x6587;&#x4EF6;&#x3002;&#x8FD9;&#x91CC;&#x7684;&#x767B;&#x5F55;&#x4E0D;&#x4EC5;&#x6307;&#x7684;&#x662F;Google&#x767B;&#x5F55;&#x8FD8;&#x6709;Facebook&#x767B;&#x5F55;&#xFF0C;&#x56E0;&#x4E3A;&#x7B7E;&#x540D;&#x53D8;&#x4E86;&#x4E4B;&#x540E;SHA1&#x4E5F;&#x4F1A;&#x6539;&#x53D8;&#x3002;&#x6240;&#x4EE5;&#xFF0C;Google&#x9700;&#x8981;&#x66F4;&#x65B0;<strong>Android&#x7248;&#x7684;<code>AuthID</code>&#x7684;SHA1</strong>&#xFF0C;Face book&#x9700;&#x8981;&#x66F4;&#x65B0;&#x65B0;&#x7684;<code>&#x6563;&#x5217;&#x5BC6;&#x94A5;</code>&#x3002;</p>
<p><strong>&#x8BF4;&#x4E86;&#x90A3;&#x4E48;&#x591A;&#xFF0C;&#x6765;&#x770B;&#x770B;&#x81EA;&#x5DF1;&#x7684;&#x7B7E;&#x540D;&#x548C;Google&#x5206;&#x914D;&#x7684;&#x7B7E;&#x540D;</strong><br>![Google&#x7B7E;&#x540D;.png](Android &#x5173;&#x4E8E;&#x52A0;&#x5165;Google&#x7B7E;&#x540D;&#x8BA1;&#x5212;&#xFF08;&#x5206;&#x914D;&#x7684;&#x7B7E;&#x540D;&#x6587;&#x4EF6;&#xFF09;Google&#x548C;Facebook&#x767B;&#x5F55;&#x4E0D;&#x6210;&#x529F;&#x7684;&#x95EE;&#x9898;/Google&#x7B7E;&#x540D;.png)</p>
<blockquote>
<p>&#x5982;&#x4E0A;&#x56FE;&#x6240;&#x793A;&#xFF0C;&#x53EF;&#x4EE5;&#x770B;&#x5230;Google&#x5206;&#x914D;&#x7684;&#x7B7E;&#x540D;&#xFF0C;&#x8FD9;&#x91CC;&#x9762;&#x4F1A;&#x751F;&#x6210;&#x65B0;&#x7684;<code>SHA1</code>&#x3001;<code>MD5</code>&#x548C;<code>SHA-256</code>,&#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x6240;&#x9700;&#x8981;&#x7684;&#x662F;&#x4EC0;&#x4E48;&#x5462;&#xFF0C;&#x505A;&#x8FC7;google&#x767B;&#x5F55;&#x7684;&#x90FD;&#x77E5;&#x9053;&#x9700;&#x8981;SHA1&#xFF0C;&#x90A3;&#x4E48;&#x95EE;&#x9898;&#x6765;&#x4E86;&#x3002;&#x9700;&#x8981;&#x7528;&#x65B0;&#x7684;SHA1&#x8FD8;&#x662F;&#x81EA;&#x5DF1;&#x539F;&#x6765;&#x7684;SHA1&#x5462;&#xFF1F;&#x5F53;&#x7136;&#x662F;&#x8981;&#x7528;Google&#x5206;&#x914D;&#x7684;SHA1&#x4E86;&#x3002;&#x56E0;&#x4E3A;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x5728;Google Play&#x4E0A;&#x9762;&#x53D1;&#x5E03;&#x5E94;&#x7528;&#x3002;</p>
</blockquote>
<h4 id="&#x5176;&#x6B21;"><a href="#&#x5176;&#x6B21;" class="headerlink" title="&#x5176;&#x6B21;"></a>&#x5176;&#x6B21;</h4><blockquote>
<p>&#x4E0A;&#x9762;&#x8BF4;&#x4E86;&#x90A3;&#x4E48;&#x591A;&#x7684;&#x539F;&#x56E0;&#xFF0C;&#x90A3;&#x4E48;&#x4E0B;&#x9762;&#x6765;&#x770B;&#x89E3;&#x51B3;&#x529E;&#x6CD5;&#x3002;</p>
</blockquote>
<ul>
<li><p>&#x5173;&#x4E8E;Google&#x767B;&#x5F55;&#x7684;&#x914D;&#x7F6E;&#xFF0C;&#x53EF;&#x4EE5;&#x770B;&#x8FD9;&#x7BC7;<a href="https://juejin.im/post/5d5cae71e51d453bc64801ec" target="_blank" rel="noopener">Google&#x767B;&#x5F55;&#x914D;&#x7F6E;</a>,&#x5982;&#x679C;&#x914D;&#x7F6E;&#x8FC7;&#x4E86;&#xFF0C;&#x90A3;&#x4E48;&#x770B;&#x4E00;&#x4E0B;&#x5982;&#x4F55;&#x4FEE;&#x6539;&#xFF0C;&#x6211;&#x4EEC;&#x53EA;&#x9700;&#x8981;&#x4FEE;&#x6539;Android&#x7248;&#x7684;<code>AuthID</code>&#xFF0C;&#x5E76;&#x4E14;&#x4FEE;&#x6539;&#x91CC;&#x9762;&#x5BF9;&#x5E94;&#x7684;<code>SHA1</code>&#x3002;<br>![&#x52A0;&#x5165;Google&#x7B7E;&#x540D;&#x540E;&#x4FEE;&#x6539;SHA1&#x7684;&#x5730;&#x65B9;.png](Android &#x5173;&#x4E8E;&#x52A0;&#x5165;Google&#x7B7E;&#x540D;&#x8BA1;&#x5212;&#xFF08;&#x5206;&#x914D;&#x7684;&#x7B7E;&#x540D;&#x6587;&#x4EF6;&#xFF09;Google&#x548C;Facebook&#x767B;&#x5F55;&#x4E0D;&#x6210;&#x529F;&#x7684;&#x95EE;&#x9898;/&#x52A0;&#x5165;Google&#x7B7E;&#x540D;&#x540E;&#x4FEE;&#x6539;SHA1&#x7684;&#x5730;&#x65B9;.png)<br><strong>&#x6CE8;&#x610F;&#xFF1A;<code>SHA1</code>&#x8FD9;&#x91CC;&#x9700;&#x8981;&#x66F4;&#x6362;&#x6210;Google&#x5206;&#x914D;&#x7684;&#x7B7E;&#x540D;&#x7684;<code>SHA1</code>&#x5176;&#x4ED6;&#x7684;&#x4FDD;&#x6301;&#x4E0D;&#x53D8;&#x3002;</strong></p>
</li>
<li><p>&#x4E5F;&#x6709;&#x540C;&#x4EC1;&#x9047;&#x5230;&#x8FC7;Facebook&#x767B;&#x5F55;&#x5931;&#x8D25;&#x7684;&#x95EE;&#x9898;&#xFF0C;&#x8BF4;&#x7684;&#x662F;<code>&#x6563;&#x5217;&#x5BC6;&#x94A5;</code>&#x9519;&#x8BEF;&#x3002;&#x90A3;&#x4E48;&#xFF0C;&#x6211;&#x4EEC;&#x7684;<code>&#x6563;&#x5217;&#x5BC6;&#x94A5;</code>&#x662F;&#x600E;&#x4E48;&#x751F;&#x6210;&#x7684;&#x5462;&#xFF1F;</p>
<pre><code>keytool -exportcert -alias &#xFF08;&#x7B7E;&#x540D;&#x7684;&#x522B;&#x540D;&#xFF09; -keystore &#xFF08;&#x7B7E;&#x540D;&#x6587;&#x4EF6;&#x8DEF;&#x5F84;&#xFF09; | openssl sha1 -binary | openssl base64</code></pre></li>
</ul>
<blockquote>
<p>&#x4E0A;&#x9762;&#x7684;&#x5C31;&#x662F;&#x6211;&#x4EEC;&#x751F;&#x6210;&#x6563;&#x5217;&#x5BC6;&#x94A5;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x9700;&#x8981;&#x7B7E;&#x540D;&#x7684;&#x522B;&#x540D;&#x548C;&#x8DEF;&#x5F84;&#xFF0C;&#x5F53;&#x7136;&#x8FD8;&#x8981;&#x6709;&#x5BC6;&#x94A5;&#x3002;&#x5F53;&#x6211;&#x4EEC;&#x6709;&#x7B7E;&#x540D;&#x7684;&#x65F6;&#x5019;&#x5F53;&#x7136;&#x4F1A;&#x5F88;&#x5BB9;&#x6613;&#x7684;&#x751F;&#x6210;&#xFF0C;&#x90A3;&#x4E48;Google&#x5206;&#x914D;&#x7684;&#x7B7E;&#x540D;&#x5462;&#xFF1F;&#x6211;&#x4EEC;&#x600E;&#x4E48;&#x77E5;&#x9053;&#x522B;&#x540D;&#xFF1F;&#x600E;&#x4E48;&#x77E5;&#x9053;&#x8DEF;&#x5F84;&#xFF1F;&#x600E;&#x4E48;&#x77E5;&#x9053;&#x5BC6;&#x94A5;&#xFF1F;&#x522B;&#x62C5;&#x5FC3;&#xFF0C;&#x8FD9;&#x91CC;&#x7ED9;&#x4F60;&#x89E3;&#x51B3;&#x65B9;&#x6CD5;&#x3002;</p>
</blockquote>
<ul>
<li>1&#x3001;&#x8FD9;&#x91CC;&#x6211;&#x6839;&#x636E;<a href="http://tomeko.net/online_tools/hex_to_base64.php" target="_blank" rel="noopener">&#x5F53;&#x524D;&#x7F51;&#x5740;</a>&#x7684;JS&#x6E90;&#x7801;&#x7684;&#x7B97;&#x6CD5;&#xFF0C;&#x81EA;&#x5DF1;&#x5199;&#x51FA;&#x4E86;&#x4E00;&#x5957;<code>JAVA</code>&#x548C;<code>kotlin</code>&#x6E90;&#x7801;,&#x5F53;&#x524D;&#x7F51;&#x5740;&#x662F;&#x5982;&#x4E0B;&#x56FE;&#x6240;&#x793A;&#x7684;&#x7528;&#x6CD5;<br>![&#x6839;&#x636E;SHA1&#x751F;&#x6210;&#x6563;&#x5217;&#x5BC6;&#x94A5;.png](Android &#x5173;&#x4E8E;&#x52A0;&#x5165;Google&#x7B7E;&#x540D;&#x8BA1;&#x5212;&#xFF08;&#x5206;&#x914D;&#x7684;&#x7B7E;&#x540D;&#x6587;&#x4EF6;&#xFF09;Google&#x548C;Facebook&#x767B;&#x5F55;&#x4E0D;&#x6210;&#x529F;&#x7684;&#x95EE;&#x9898;/&#x6839;&#x636E;SHA1&#x751F;&#x6210;&#x6563;&#x5217;&#x5BC6;&#x94A5;.png)</li>
</ul>
<p><strong>&#x5982;&#x4E0A;&#x56FE;&#x6240;&#x793A;&#xFF0C;&#x6211;&#x4EEC;&#x53EA;&#x9700;&#x8981;&#x586B;&#x5165;Google&#x5206;&#x914D;&#x7ED9;&#x6211;&#x4EEC;&#x7684;&#x65B0;&#x7684;<code>SHA1</code>&#x5373;&#x53EF;&#x751F;&#x6210;<code>&#x6563;&#x5217;&#x5BC6;&#x94A5;</code>&#x7136;&#x540E;&#x586B;&#x5165;&#x5230;Facebook&#x7684;&#x540E;&#x53F0;&#x914D;&#x7F6E;&#x4E2D;&#x3002;</strong></p>
<ul>
<li><p>2&#x3001;&#x4EE3;&#x7801;&#x4E2D;&#x7684;&#x7528;&#x6CD5;&#x662F;&#x5982;&#x4F55;&#x7684;&#x5462;&#xFF1F;&#x4E14;&#x770B;&#x4E0B;&#x9762;&#x7684;&#x6E90;&#x7801;</p>
<blockquote>
<p><code>java</code>&#x7248;&#x7684;</p>
</blockquote>
<pre><code> /**
  * &#x8F6C;&#x6362;&#x5DE5;&#x5177;&#x7C7B;
  */
 public class ConvertUtil {

 /**
  * &#x8F93;&#x5165;&#x5185;&#x5BB9;
  *
  * @param input   &#x8F93;&#x5165;&#x7684;&#x5185;&#x5BB9;
  * @param isCheck &#x662F;&#x5426;&#x53D6;&#x6D88;&#x9009;&#x62E9;OX
  * @return &#x8FD4;&#x56DE;&#x53D6;&#x6D88;OX&#x540E;&#x7684;&#x503C;
  */
private static String input(String input, boolean isCheck) {
  input = input.toUpperCase();
  if (isCheck) {
      Pattern pattern = Pattern.compile(&quot;0X&quot;);
      Matcher matcher = pattern.matcher(input);
      input = matcher.replaceAll(&quot;&quot;);
  }
  Pattern pattern = Pattern.compile(&quot;[^A-Fa-f0-9]&quot;);
  Matcher matcher = pattern.matcher(input);
  input = matcher.replaceAll(&quot;&quot;);
  return input;
}

 /**
  * &#x8F6C;&#x6362;
  *
  * @param input   &#x8F93;&#x5165;&#x7684;&#x5185;&#x5BB9;
  * @param isCheck &#x662F;&#x5426;&#x53D6;&#x6D88;&#x9009;&#x62E9;OX
  * @return &#x8FD4;&#x56DE;&#x6563;&#x5217;&#x5BC6;&#x94A5;
  */
public static String convert(String input, boolean isCheck) {
  String array;
  String result = input(input, isCheck);
  if (result.length() % 2 != 0) {
      return &quot;123&quot;;
  }
  int[] mArray = new int[result.length() / 2];
  for (int index = 0; index &lt; result.length() / 2; index++) {
      String h = result.substring(index * 2, index * 2 + 2);
      Log.e(&quot;TA&quot;, h + &quot;&quot;);
      mArray[index] = Integer.parseInt(h, 16);
  }
  array = convertTo64(mArray);
  return array;
}

/**
 * &#x8F6C;&#x6362;&#x4E3A;64&#x4E3A;&#x7684;String&#x5B57;&#x7B26;&#x4E32;
 *
 * @param input int &#x6570;&#x7EC4;
 * @return &#x8F6C;&#x6362;&#x540E;&#x7684;&#x6563;&#x5217;&#x5BC6;&#x94A5;
 */
private static String convertTo64(int[] input) {
  String base64_chars = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/&quot;;
  String ret = &quot;&quot;;
  int i = 0;
  int j = 0;
  int[] char_array_3 = new int[3];
  int[] char_array_4 = new int[4];
  int in_len = input.length;
  int pos = 0;

  while (in_len-- != 0) {
      char_array_3[i++] = input[pos++];
      if (i == 3) {
          char_array_4[0] = (char_array_3[0] &amp; 0xfc) &gt;&gt; 2;
          char_array_4[1] = ((char_array_3[0] &amp; 0x03) &lt;&lt; 4) + ((char_array_3[1] &amp; 0xf0) &gt;&gt; 4);
          char_array_4[2] = ((char_array_3[1] &amp; 0x0f) &lt;&lt; 2) + ((char_array_3[2] &amp; 0xc0) &gt;&gt; 6);
          char_array_4[3] = char_array_3[2] &amp; 0x3f;

          for (i = 0; (i &lt; 4); i++)
              ret += base64_chars.charAt(char_array_4[i]);
          i = 0;
      }
  }

  if (i != 0) {
      for (j = i; j &lt; 3; j++)
          char_array_3[j] = 0;

      char_array_4[0] = (char_array_3[0] &amp; 0xfc) &gt;&gt; 2;
      char_array_4[1] = ((char_array_3[0] &amp; 0x03) &lt;&lt; 4) + ((char_array_3[1] &amp; 0xf0) &gt;&gt; 4);
      char_array_4[2] = ((char_array_3[1] &amp; 0x0f) &lt;&lt; 2) + ((char_array_3[2] &amp; 0xc0) &gt;&gt; 6);
      char_array_4[3] = char_array_3[2] &amp; 0x3f;

      for (j = 0; (j &lt; i + 1); j++)
          ret += base64_chars.charAt(char_array_4[j]);

      while ((i++ &lt; 3))
          ret += &apos;=&apos;;

  }
  return ret;
 }</code></pre></li>
</ul>
<pre><code>}</code></pre><blockquote>
<p><code>kotlin</code>&#x7248;&#x7684;&#x5982;&#x4E0B;</p>
</blockquote>
<pre><code> /**
  * &#x8F6C;&#x6362;&#x5DE5;&#x5177;&#x7C7B;
  */
 object ConvertUtil {

/**
 * &#x8F6C;&#x6362;
 *
 * @param input   &#x8F93;&#x5165;&#x7684;&#x5185;&#x5BB9;
 * @param isCheck &#x662F;&#x5426;&#x53D6;&#x6D88;&#x9009;&#x62E9;OX
 * @return &#x8FD4;&#x56DE;&#x6563;&#x5217;&#x5BC6;&#x94A5;
 */
fun convert(input: String, isCheck: Boolean): String {
    val array: String
    val result = input(input, isCheck)
    if (result.length % 2 != 0) {
        return &quot;123&quot;
    }
    val mArray = IntArray(result.length / 2)
    for (index in 0 until result.length / 2) {
        val h = result.substring(index * 2, index * 2 + 2)
        mArray[index] = h.toInt(16)
    }
    array = convertTo64(mArray)
    return array
}

/**
 * &#x8F93;&#x5165;&#x5185;&#x5BB9;
 *
 * @param input   &#x8F93;&#x5165;&#x7684;&#x5185;&#x5BB9;
 * @param isCheck &#x662F;&#x5426;&#x53D6;&#x6D88;&#x9009;&#x62E9;OX
 * @return &#x8FD4;&#x56DE;&#x53D6;&#x6D88;OX&#x540E;&#x7684;&#x503C;
 */
private fun input(input: String, isCheck: Boolean): String {
    var input = input
    input = input.toUpperCase()
    if (isCheck) {
        val pattern = Pattern.compile(&quot;0X&quot;)
        val matcher = pattern.matcher(input)
        input = matcher.replaceAll(&quot;&quot;)
    }
    val pattern = Pattern.compile(&quot;[^A-Fa-f0-9]&quot;)
    val matcher = pattern.matcher(input)
    input = matcher.replaceAll(&quot;&quot;)
    return input
}


/**
 * &#x8F6C;&#x6362;&#x4E3A;64&#x4E3A;&#x7684;String&#x5B57;&#x7B26;&#x4E32;
 *
 * @param input int &#x6570;&#x7EC4;
 * @return &#x8F6C;&#x6362;&#x540E;&#x7684;&#x6563;&#x5217;&#x5BC6;&#x94A5;
 */
private fun convertTo64(input: IntArray): String {
    val base64_chars = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/&quot;
    var ret = &quot;&quot;
    var i = 0
    var j = 0
    val char_array_3 = IntArray(3)
    val char_array_4 = IntArray(4)
    var in_len = input.size
    var pos = 0
    while (in_len-- != 0) {
        char_array_3[i++] = input[pos++]
        if (i == 3) {
            char_array_4[0] = char_array_3[0] and 0xfc shr 2
            char_array_4[1] =
                (char_array_3[0] and 0x03 shl 4) + (char_array_3[1] and 0xf0 shr 4)
            char_array_4[2] =
                (char_array_3[1] and 0x0f shl 2) + (char_array_3[2] and 0xc0 shr 6)
            char_array_4[3] = char_array_3[2] and 0x3f
            i = 0
            while (i &lt; 4) {
                ret += base64_chars[char_array_4[i]]
                i++
            }
            i = 0
        }
    }
    if (i != 0) {
        j = i
        while (j &lt; 3) {
            char_array_3[j] = 0
            j++
        }
        char_array_4[0] = char_array_3[0] and 0xfc shr 2
        char_array_4[1] = (char_array_3[0] and 0x03 shl 4) + (char_array_3[1] and 0xf0 shr 4)
        char_array_4[2] = (char_array_3[1] and 0x0f shl 2) + (char_array_3[2] and 0xc0 shr 6)
        char_array_4[3] = char_array_3[2] and 0x3f
        j = 0
        while (j &lt; i + 1) {
            ret += base64_chars[char_array_4[j]]
            j++
        }
        while (i++ &lt; 3) ret += &apos;=&apos;
    }
    return ret
}
}</code></pre><ul>
<li>3&#x3001;&#x5173;&#x4E8E;Facebook&#x5982;&#x4F55;&#x914D;&#x7F6E;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x592A;&#x660E;&#x767D;&#x7684;&#x8BDD;&#x53EF;&#x4EE5;&#x770B;&#x770B;&#x8FD9;&#x7BC7;&#xFF1A;<a href="https://juejin.im/post/5d5cae3ee51d4561ad6548bb" target="_blank" rel="noopener">Facebook &#x914D;&#x7F6E;</a>,&#x5173;&#x4E8E;&#x5982;&#x4F55;&#x914D;&#x7F6E;<code>&#x6563;&#x5217;&#x5BC6;&#x94A5;</code>?&#x53EF;&#x4EE5;&#x770B;&#x4E0B;&#x56FE;<br>![&#x52A0;&#x5165;google&#x7B7E;&#x540D;&#x8BA1;&#x5212;&#x540E;&#x7684;&#x6563;&#x5217;&#x5BC6;&#x94A5;.png](Android &#x5173;&#x4E8E;&#x52A0;&#x5165;Google&#x7B7E;&#x540D;&#x8BA1;&#x5212;&#xFF08;&#x5206;&#x914D;&#x7684;&#x7B7E;&#x540D;&#x6587;&#x4EF6;&#xFF09;Google&#x548C;Facebook&#x767B;&#x5F55;&#x4E0D;&#x6210;&#x529F;&#x7684;&#x95EE;&#x9898;/&#x52A0;&#x5165;google&#x7B7E;&#x540D;&#x8BA1;&#x5212;&#x540E;&#x7684;&#x6563;&#x5217;&#x5BC6;&#x94A5;.png)<br>  <strong>&#x5982;&#x4E0A;&#x56FE;&#x6240;&#x793A;&#x8FD9;&#x91CC;&#x7684;<code>&#x6563;&#x5217;&#x5BC6;&#x94A5;</code>&#x6362;&#x6210;&#x521A;&#x751F;&#x6210;&#x7684;&#x5373;&#x53EF;&#x3002;</strong><h4 id="&#x6700;&#x540E;"><a href="#&#x6700;&#x540E;" class="headerlink" title="&#x6700;&#x540E;"></a>&#x6700;&#x540E;</h4><blockquote>
<p>&#x597D;&#x4E86;&#xFF0C;&#x5230;&#x6B64;&#x6211;&#x4EEC;&#x4ECA;&#x5929;&#x7684;&#x6587;&#x7AE0;&#x5C31;&#x7ED3;&#x675F;&#x4E86;&#x3002;&#x5173;&#x4E8E;&#x5982;&#x4F55;&#x89E3;&#x51B3;Google&#x548C;Facebook&#x52A0;&#x5165;&#x7B7E;&#x540D;&#x8BA1;&#x5212;&#x540E;&#x4E0D;&#x80FD;&#x6210;&#x529F;&#x767B;&#x5F55;&#x7684;&#x95EE;&#x9898;&#x5C31;&#x5230;&#x6B64;&#x7ED3;&#x675F;&#x4E86;&#x3002;&#x5982;&#x679C;&#x8FD8;&#x6709;&#x5176;&#x4ED6;&#x95EE;&#x9898;&#x53EF;&#x4EE5;<code>&#x52A0;&#x7FA4;&#x63A2;&#x8BA8;</code>,&#x7FA4;&#x53F7;&#x662F;&#xFF1A;<code>493180098</code></p>
</blockquote>
</li>
</ul>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2020/01/20/Untitled/" rel="next" title>
                <i class="fa fa-chevron-left"></i> 
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2020/03/06/乐推SDK登录接入说明/" rel="prev" title="乐推SDK登录接入说明">
                乐推SDK登录接入说明 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Silence潇湘夜雨</p>
              <p class="site-description motion-element" itemprop="description">Android开发一枚</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">55</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">16</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/muyishuangfeng" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/1e2eec6f972c" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>简书</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/58df0abf61ff4b006b115e43" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-star"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://twitter.com/yangke20792452" target="_blank" title="Twitter">
                      
                        <i class="fa fa-fw fa-twitter"></i>Twitter</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#前提："><span class="nav-number">1.</span> <span class="nav-text">前提：</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#首先"><span class="nav-number">1.1.</span> <span class="nav-text">首先</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#其次"><span class="nav-number">1.2.</span> <span class="nav-text">其次</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#最后"><span class="nav-number">1.3.</span> <span class="nav-text">最后</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      
        <div class="back-to-top">
          <i class="fa fa-arrow-up"></i>
          
            <span id="scrollpercent"><span>0</span>%</span>
          
        </div>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Silence潇湘夜雨</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">Site words total count&#58;</span>
    
    <span title="Site words total count">114.8k</span>
  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.4</div>




        







        
      </div>
    </footer>

    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

  <!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/love.js"></script>
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"model":{"scale":1,"hHeadPos":0.5,"vHeadPos":0.618},"display":{"superSample":2,"width":150,"height":300,"position":"right","hOffset":0,"vOffset":-20},"mobile":{"show":false},"react":{"opacityDefault":0.5,"opacityOnHover":0.5},"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
